export default {
  state: {
    marchineLabelList: [],  // 机台条码
    containerLabelList:[],   // 容器条码
    defectReason:'',   // 不良原因
    unfinishReason:'', // 未完成原因
    woData:'', //派工单信息
    group:'', // 报工人员
    piece:''  // 计件组别或人员
  },
  getters: {
    getMarchineLabelList(state) {
      return state.marchineLabelList
    },
    getContainerLabelList(state) {
      return state.containerLabelList
    },
    getDefectReason(state){
      return state.defectReason
    },
    getUnfinishReason(state){
      return state.unfinishReason
    },
    getWoData(state){
      return state.woData
    },
    getGroup(state){
      return state.group
    },
    getPiece(state){
      return state.piece
    }
  },
  mutations: {
    // 机台条码
    addMarchineLabelList(state, data) {
      state.marchineLabelList.push(data);
    },
    deleteMarchineLabelList(state, index) {
      state.marchineLabelList.splice(index, 1);
    },
    resetMarchineLabelList(state){
      state.marchineLabelList = []
    },
    // 容器条码
    addContainerLabelList(state,data){
      state.containerLabelList.push(data)
    },
    deleteContainerLabelList(state,index){
      state.containerLabelList.splice(index,1);
    },
    resetContainerLabelList(state){
      state.containerLabelList = []
    },
    // 不良原因
    addDefectReason(state,data){
      state.defectReason = data;
    },
    // 未完成原因
    addUnfinishReason(state,data){
      state.unfinishReason = data;
    },
    // 派工单信息
    addWoData(state,data){
      state.woData = data;
    },

    // 计件人员
    addGroup(state,data){
      state.group = data
    },
    //计件方式
    addPiece(state,data){
      state.piece = data
    }



  }
}
